import mcpi.minecraft as minecraft
import mcpi.block as block
mc = minecraft.Minecraft.create()

spiderHouse=[-13,0,-11]
creeperHouse=[-13,-1,-23]
endermanHouse=[-24,0,-9]

while True:
    a = mc.player.getEntities(10)
    for i in a:
        if i[2] == 'SPIDER':
            mc.entity.setPos(i[0],spiderHouse[0],spiderHouse[1],spiderHouse[2])
        elif i[2]=='CREEPER':
            mc.entity.setPos(i[0], creeperHouse[0], creeperHouse[1], creeperHouse[2])
        elif i[2]=='ENDERMAN':
            mc.entity.setPos(i[0], endermanHouse[0], endermanHouse[1], endermanHouse[2])
